\(\int \frac {a+a \cos (e+f x)}{c+d x} \, dx\) [121]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [C] (verification not implemented)
   Giac [C] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 18, antiderivative size = 65 \[ \int \frac {a+a \cos (e+f x)}{c+d x} \, dx=\frac {a \cos \left (e-\frac {c f}{d}\right ) \operatorname {CosIntegral}\left (\frac {c f}{d}+f x\right )}{d}+\frac {a \log (c+d x)}{d}-\frac {a \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (\frac {c f}{d}+f x\right )}{d} \]

[Out]

a*Ci(c*f/d+f*x)*cos(-e+c*f/d)/d+a*ln(d*x+c)/d+a*Si(c*f/d+f*x)*sin(-e+c*f/d)/d

Rubi [A] (verified)

Time = 0.17 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {3398, 3384, 3380, 3383} \[ \int \frac {a+a \cos (e+f x)}{c+d x} \, dx=\frac {a \operatorname {CosIntegral}\left (x f+\frac {c f}{d}\right ) \cos \left (e-\frac {c f}{d}\right )}{d}-\frac {a \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (x f+\frac {c f}{d}\right )}{d}+\frac {a \log (c+d x)}{d} \]

[In]

Int[(a + a*Cos[e + f*x])/(c + d*x),x]

[Out]

(a*Cos[e - (c*f)/d]*CosIntegral[(c*f)/d + f*x])/d + (a*Log[c + d*x])/d - (a*Sin[e - (c*f)/d]*SinIntegral[(c*f)
/d + f*x])/d

Rule 3380

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinIntegral[e + f*x]/d, x] /; FreeQ[{c, d,
 e, f}, x] && EqQ[d*e - c*f, 0]

Rule 3383

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rule 3384

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[c*(f/d) + f*x]
/(c + d*x), x], x] + Dist[Sin[(d*e - c*f)/d], Int[Cos[c*(f/d) + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f},
x] && NeQ[d*e - c*f, 0]

Rule 3398

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, (a + b*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 0] && (EqQ[n, 1] ||
IGtQ[m, 0] || NeQ[a^2 - b^2, 0])

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {a}{c+d x}+\frac {a \cos (e+f x)}{c+d x}\right ) \, dx \\ & = \frac {a \log (c+d x)}{d}+a \int \frac {\cos (e+f x)}{c+d x} \, dx \\ & = \frac {a \log (c+d x)}{d}+\left (a \cos \left (e-\frac {c f}{d}\right )\right ) \int \frac {\cos \left (\frac {c f}{d}+f x\right )}{c+d x} \, dx-\left (a \sin \left (e-\frac {c f}{d}\right )\right ) \int \frac {\sin \left (\frac {c f}{d}+f x\right )}{c+d x} \, dx \\ & = \frac {a \cos \left (e-\frac {c f}{d}\right ) \operatorname {CosIntegral}\left (\frac {c f}{d}+f x\right )}{d}+\frac {a \log (c+d x)}{d}-\frac {a \sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (\frac {c f}{d}+f x\right )}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.22 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.85 \[ \int \frac {a+a \cos (e+f x)}{c+d x} \, dx=\frac {a \left (\cos \left (e-\frac {c f}{d}\right ) \operatorname {CosIntegral}\left (f \left (\frac {c}{d}+x\right )\right )+\log (c+d x)-\sin \left (e-\frac {c f}{d}\right ) \text {Si}\left (f \left (\frac {c}{d}+x\right )\right )\right )}{d} \]

[In]

Integrate[(a + a*Cos[e + f*x])/(c + d*x),x]

[Out]

(a*(Cos[e - (c*f)/d]*CosIntegral[f*(c/d + x)] + Log[c + d*x] - Sin[e - (c*f)/d]*SinIntegral[f*(c/d + x)]))/d

Maple [A] (verified)

Time = 0.93 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.32

method result size
parts \(\frac {a \ln \left (d x +c \right )}{d}+a \left (\frac {\operatorname {Si}\left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\operatorname {Ci}\left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}\right )\) \(86\)
derivativedivides \(\frac {a f \left (\frac {\operatorname {Si}\left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\operatorname {Ci}\left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}\right )+\frac {a f \ln \left (c f -d e +d \left (f x +e \right )\right )}{d}}{f}\) \(102\)
default \(\frac {a f \left (\frac {\operatorname {Si}\left (f x +e +\frac {c f -d e}{d}\right ) \sin \left (\frac {c f -d e}{d}\right )}{d}+\frac {\operatorname {Ci}\left (f x +e +\frac {c f -d e}{d}\right ) \cos \left (\frac {c f -d e}{d}\right )}{d}\right )+\frac {a f \ln \left (c f -d e +d \left (f x +e \right )\right )}{d}}{f}\) \(102\)
risch \(\frac {a \ln \left (d x +c \right )}{d}-\frac {a \,{\mathrm e}^{\frac {i \left (c f -d e \right )}{d}} \operatorname {Ei}_{1}\left (i f x +i e +\frac {i \left (c f -d e \right )}{d}\right )}{2 d}-\frac {a \,{\mathrm e}^{-\frac {i \left (c f -d e \right )}{d}} \operatorname {Ei}_{1}\left (-i f x -i e -\frac {i c f -i d e}{d}\right )}{2 d}\) \(109\)

[In]

int((a+cos(f*x+e)*a)/(d*x+c),x,method=_RETURNVERBOSE)

[Out]

a*ln(d*x+c)/d+a*(Si(f*x+e+(c*f-d*e)/d)*sin((c*f-d*e)/d)/d+Ci(f*x+e+(c*f-d*e)/d)*cos((c*f-d*e)/d)/d)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.09 \[ \int \frac {a+a \cos (e+f x)}{c+d x} \, dx=\frac {a \cos \left (-\frac {d e - c f}{d}\right ) \operatorname {Ci}\left (\frac {d f x + c f}{d}\right ) + a \sin \left (-\frac {d e - c f}{d}\right ) \operatorname {Si}\left (\frac {d f x + c f}{d}\right ) + a \log \left (d x + c\right )}{d} \]

[In]

integrate((a+a*cos(f*x+e))/(d*x+c),x, algorithm="fricas")

[Out]

(a*cos(-(d*e - c*f)/d)*cos_integral((d*f*x + c*f)/d) + a*sin(-(d*e - c*f)/d)*sin_integral((d*f*x + c*f)/d) + a
*log(d*x + c))/d

Sympy [F]

\[ \int \frac {a+a \cos (e+f x)}{c+d x} \, dx=a \left (\int \frac {\cos {\left (e + f x \right )}}{c + d x}\, dx + \int \frac {1}{c + d x}\, dx\right ) \]

[In]

integrate((a+a*cos(f*x+e))/(d*x+c),x)

[Out]

a*(Integral(cos(e + f*x)/(c + d*x), x) + Integral(1/(c + d*x), x))

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.33 (sec) , antiderivative size = 172, normalized size of antiderivative = 2.65 \[ \int \frac {a+a \cos (e+f x)}{c+d x} \, dx=\frac {\frac {2 \, a f \log \left (c + \frac {{\left (f x + e\right )} d}{f} - \frac {d e}{f}\right )}{d} - \frac {{\left (f {\left (E_{1}\left (\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right ) + E_{1}\left (-\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right )\right )} \cos \left (-\frac {d e - c f}{d}\right ) + f {\left (i \, E_{1}\left (\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right ) - i \, E_{1}\left (-\frac {i \, {\left (f x + e\right )} d - i \, d e + i \, c f}{d}\right )\right )} \sin \left (-\frac {d e - c f}{d}\right )\right )} a}{d}}{2 \, f} \]

[In]

integrate((a+a*cos(f*x+e))/(d*x+c),x, algorithm="maxima")

[Out]

1/2*(2*a*f*log(c + (f*x + e)*d/f - d*e/f)/d - (f*(exp_integral_e(1, (I*(f*x + e)*d - I*d*e + I*c*f)/d) + exp_i
ntegral_e(1, -(I*(f*x + e)*d - I*d*e + I*c*f)/d))*cos(-(d*e - c*f)/d) + f*(I*exp_integral_e(1, (I*(f*x + e)*d
- I*d*e + I*c*f)/d) - I*exp_integral_e(1, -(I*(f*x + e)*d - I*d*e + I*c*f)/d))*sin(-(d*e - c*f)/d))*a/d)/f

Giac [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.30 (sec) , antiderivative size = 673, normalized size of antiderivative = 10.35 \[ \int \frac {a+a \cos (e+f x)}{c+d x} \, dx=\text {Too large to display} \]

[In]

integrate((a+a*cos(f*x+e))/(d*x+c),x, algorithm="giac")

[Out]

1/2*(2*a*log(abs(d*x + c))*tan(1/2*e)^2*tan(1/2*c*f/d)^2 + a*real_part(cos_integral(f*x + c*f/d))*tan(1/2*e)^2
*tan(1/2*c*f/d)^2 + a*real_part(cos_integral(-f*x - c*f/d))*tan(1/2*e)^2*tan(1/2*c*f/d)^2 - 2*a*imag_part(cos_
integral(f*x + c*f/d))*tan(1/2*e)^2*tan(1/2*c*f/d) + 2*a*imag_part(cos_integral(-f*x - c*f/d))*tan(1/2*e)^2*ta
n(1/2*c*f/d) - 4*a*sin_integral((d*f*x + c*f)/d)*tan(1/2*e)^2*tan(1/2*c*f/d) + 2*a*imag_part(cos_integral(f*x
+ c*f/d))*tan(1/2*e)*tan(1/2*c*f/d)^2 - 2*a*imag_part(cos_integral(-f*x - c*f/d))*tan(1/2*e)*tan(1/2*c*f/d)^2
+ 4*a*sin_integral((d*f*x + c*f)/d)*tan(1/2*e)*tan(1/2*c*f/d)^2 + 2*a*log(abs(d*x + c))*tan(1/2*e)^2 - a*real_
part(cos_integral(f*x + c*f/d))*tan(1/2*e)^2 - a*real_part(cos_integral(-f*x - c*f/d))*tan(1/2*e)^2 + 4*a*real
_part(cos_integral(f*x + c*f/d))*tan(1/2*e)*tan(1/2*c*f/d) + 4*a*real_part(cos_integral(-f*x - c*f/d))*tan(1/2
*e)*tan(1/2*c*f/d) + 2*a*log(abs(d*x + c))*tan(1/2*c*f/d)^2 - a*real_part(cos_integral(f*x + c*f/d))*tan(1/2*c
*f/d)^2 - a*real_part(cos_integral(-f*x - c*f/d))*tan(1/2*c*f/d)^2 - 2*a*imag_part(cos_integral(f*x + c*f/d))*
tan(1/2*e) + 2*a*imag_part(cos_integral(-f*x - c*f/d))*tan(1/2*e) - 4*a*sin_integral((d*f*x + c*f)/d)*tan(1/2*
e) + 2*a*imag_part(cos_integral(f*x + c*f/d))*tan(1/2*c*f/d) - 2*a*imag_part(cos_integral(-f*x - c*f/d))*tan(1
/2*c*f/d) + 4*a*sin_integral((d*f*x + c*f)/d)*tan(1/2*c*f/d) + 2*a*log(abs(d*x + c)) + a*real_part(cos_integra
l(f*x + c*f/d)) + a*real_part(cos_integral(-f*x - c*f/d)))/(d*tan(1/2*e)^2*tan(1/2*c*f/d)^2 + d*tan(1/2*e)^2 +
 d*tan(1/2*c*f/d)^2 + d)

Mupad [F(-1)]

Timed out. \[ \int \frac {a+a \cos (e+f x)}{c+d x} \, dx=\int \frac {a+a\,\cos \left (e+f\,x\right )}{c+d\,x} \,d x \]

[In]

int((a + a*cos(e + f*x))/(c + d*x),x)

[Out]

int((a + a*cos(e + f*x))/(c + d*x), x)